package edu.pku.sei.transformation.editor.controller.commands.link;

import edu.pku.sei.transformation.editor.model.TransformationExtend;
import edu.pku.sei.transformation.editor.model.Transformation;

public class ExtendDeleteCommand extends AbstractLinkDeleteCommand<TransformationExtend, Transformation, Transformation> {
	public ExtendDeleteCommand(TransformationExtend link,
			Transformation source, Transformation target) {
		super(link, source, target);
	}

	@Override
	public void undo() {
		source.setExtend(link);
		link.setExtendTransformation(target);
		((Transformation)source).getExtendby().add(source);
	}
	
	@Override
	public void execute() {
		source.setExtend(null);
		link.setExtendTransformation(null);
		((Transformation)source).getExtendby().remove(source);
	}
	
}
